/**
 * Created by Administrator on 2017/5/25.
 */
"use strict";
//引入模块
const mongoose = require('mongoose');
const db = require('./db');

// Schema 结构
var SubcateSchema = new mongoose.Schema({
    "scid"  :{type:Number,index: true},//scid
    "cgid"  :{type:Number,index: true},//cgid
    "type"  :{type : String,index: true}//类型
});

SubcateSchema.statics.findFn = function(obj,obj1, callback) {
    return this.model('Subcate').find(obj, callback).sort(obj1);
};
SubcateSchema.statics.findSortOne = function(obj,obj1,callback) {
    return this.model('Subcate').findOne(obj).sort(obj1).exec(callback);
};

var SubcateModel = db.model('Subcate', SubcateSchema);

module.exports=SubcateModel;